<template>
	<!-- 招商加盟页面 -->
	<view class="consult"  :style="'height:'+recyclableHeight+'rpx;'">
		<view class="headerImg">
			<image src="../../static/images/swiper/franchise.jpg" mode=""></image>	
		</view>
		<!-- 招商加盟 -->
		<!-- <view class="franchiseTitle">招商加盟</view> -->
		<view class="notice">
			<view class="notice-text">衣件宝回收微信小程序火热招商中...</view>
		</view>
		<view class="franchise">
			<view class="recycleBin" @tap="franchise">回收站加盟</view>
			<view class="housekeep" @tap="inhousekeep">家政加盟</view>
		</view>
		<!-- <view class="address">
			<view class="address-telphone">电话：400123123</view>
			<view class="addressInfo">地址：江西省吉安市青原区滨江首府19栋1212室</view>
		</view> -->
		<!-- tabbar -->
		<tabBar currentPage="consult"></tabBar>
	</view>
</template>

<script>
	import tabBar from "@/component/commen/tabbar.vue"//引入底部组件
	import util from '@/component/commen/api/util.js';
	export default {
		components:{
			tabBar,
		},
		data() {
			return {
				recyclableHeight:0,
			};
		},
		onShow() {
			this.getsystemInfo()
		},
		mounted() {
		},
		methods:{
			franchise(){//点击回收站加盟
				console.log("回收站加盟")
				// 查看回收站状态
				var params = {
					do:"Collectorinfostaus",
					op:"register",
					uid:uni.getStorageSync("uid")
				}
				util.requestWithSign(params).then(res=>{
					console.log("回收站申请状态：",res)
					if(!res.data){//2：审核通过；1：申请中,data==false:未申请
						uni.navigateTo({
							url:"/packPages/franchise/franchise"
						})
					}else if(res.data.is_status==1){
						uni.navigateTo({
							url:"/packPages/auditing/auditing"
						})
					}else{
						uni.showToast({
							title:"您已加盟！",
							icon:"none"
						})
					}
				})
				
			},
			inhousekeep(){//点击家政加盟
				uni.navigateTo({
					url:"/packPages/housekeep/housekeep"
				})
			},
			getsystemInfo() { //获取当前屏幕信息
				// 设备系统信息
				let sysInfo = uni.getSystemInfoSync()
				// console.log(sysInfo)
				// 机型适配比例系数
				let scaleFactor = 750 / sysInfo.windowWidth
				// 当前机型屏幕高度
				let windowHeight = sysInfo.windowHeight * scaleFactor
				// 滑块对应内容高度=屏幕高度-底部tabbar高度:120rpx-头部图片：210rpx-顶部滑块：80rpx
				this.recyclableHeight = windowHeight - 120
				// 当前机型屏幕宽度
				let windowWidth = sysInfo.windowWidth * scaleFactor
				// 状态栏高度
				let statusBarHeight = (sysInfo.statusBarHeight) * scaleFactor
				// 导航栏高度(ps:只针对微信小程序有效)
				// let navHeight = 0
				// 微信小程序头部胶囊信息
				// #ifdef MP-WEIXIN
				const menuButtonInfo = wx.getMenuButtonBoundingClientRect()
				// 胶囊高度
				let menuButtonHeight = menuButtonInfo.height * scaleFactor
				// 胶囊宽度
				let menuButtonWidth = menuButtonInfo.width * scaleFactor
				// 胶囊上边界的坐标
				let menuButtonTop = menuButtonInfo.top * scaleFactor
				// 胶囊右边界的坐标
				let menuButtonRight = menuButtonInfo.right * scaleFactor
				// 胶囊下边界的坐标
				let menuButtonBottom = menuButtonInfo.bottom * scaleFactor
				// 胶囊左边界的坐标
				let menuButtonLeft = menuButtonInfo.left * scaleFactor
				// 微信小程序：导航栏高度 = 胶囊高度 + (顶部距离 - 状态栏高度) * 2
				this.navHeight = menuButtonHeight + (menuButtonTop - statusBarHeight) * 2
				// console.log(this.navHeight)
				// 
				// #endif
			},
		}
	}
</script>

<style lang="scss" scoped>
.consult{
	// background: #00b388;
	// border:1px solid #f00;
	padding-bottom: 120rpx;//其中120rpx为底部tabbar的高度
	.headerImg{
		width: 100%;
		height: 380rpx;
		image{
			width:100%;
			height: 100%;
		}
	}
	.franchiseTitle{
		font-size: 86rpx;
		font-weight: bold;
		color: #00b388;
		text-align: center;
		margin-top: 20rpx;
	}
	.notice{
		padding: 30rpx;
		.notice-text{
			// background: #fff;
			width: 100%;
			color: #00b388;
			font-size: 38rpx;
			padding: 10rpx 20rpx;
			box-sizing: border-box;
		}
	}
	.franchise{
		position: absolute;
		bottom: 180rpx;
		width: 100%;
		display: flex;
		justify-content: center;
		.recycleBin{
			margin-right: 50rpx;
			
		}
		.recycleBin,.housekeep{
			padding: 20rpx 30rpx;
			margin-top: 60rpx;
			box-sizing: border-box;
			background: #00b388;
			font-size: 38rpx;
			color: #fff;
			border-radius: 20rpx;
		}
	}
	.address{
		padding: 0 20rpx;
		box-sizing: border-box;
		color: #00b388;
		display: flex;
		justify-content: center;
		margin-top: 60rpx;
		.address-telphone{
			margin-right: 20rpx
		}
		.addressInfo{
			
		}
	}
}
</style>
